/**
 * @Project TMHSC
 * @Author Tran Manh Hung
 * @Email: hungtmit@gmail.com | tmh@xwebgate.com
 * @Copyright © 2011 TMH. All rights reserved
 * @Createdate Feb 25, 2011
 * @Createtime 5:31:48 PM
 */

package com.tmh.study.aS3DP.mcv.minimalist
{
	import flash.display.Sprite;
	import flash.errors.IllegalOperationError;
	import flash.events.Event;

	/**
	 * ABSTRACT Class (Should be subclassed and not instantiated)
	 */
	public class ComponentView extends Sprite
	{
		protected var _model:Object;

		protected var _controller:Object;

		public function ComponentView(model:Object, controller:Object = null)
		{
			super();

			_model = model;
			_controller = controller;
		}

		public function add(c:ComponentView):void
		{
			throw new IllegalOperationError("Abstract class: add operation not supported");
		}

		public function remove(c:ComponentView):void
		{
			throw new IllegalOperationError("Abstract class: remove operation not supported");
		}

		public function getChild(n:int):ComponentView
		{
			throw new IllegalOperationError("Abstract class: getChild operation not supported");

			return null;
		}

		/**
		 * ABSTRACT Method (Must be overridden in a subclass)
		 */
		public function update(event:Event = null):void
		{
		}
	}
}